package com.walter.web.servlet;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.geektimes.configuration.microprofile.config.source.ServletRequestConfigSource;


public class HelloServlet extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		this.doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		//Configuration config = new ServletRequestConfiguration(req);
		ServletRequestConfigSource configSources = new ServletRequestConfigSource();
		configSources.setServletRequest(req);
		Map map = new HashMap<>();
		configSources.prepareConfigData(map);
		System.out.println("name:"+map.get("name"));
		System.out.println("age:"+map.get("age"));
	}
	
	
	
}
